package com.example.smartcity_poverty.ui.AllService.StopWhere

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.MenuItem
import com.example.smartcity_poverty.R
import kotlinx.android.synthetic.main.activity_stop_where_show_all.*

/**
 * 停车场详情
 */
class StopWhereShowAllActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        supportActionBar?.setDisplayHomeAsUpEnabled(true)
        setContentView(R.layout.activity_stop_where_show_all)
        title = "停车场信息"

        val image = intent.getStringExtra("image")
        val title = intent.getStringExtra("title")
        val kkThis = intent.getStringExtra("this")
        val ThisThis = intent.getStringExtra("ThisThis")
        val dao = intent.getStringExtra("dao")
        val size = intent.getStringExtra("Size")

        title?.let { stopShowTitle.text = title }
        kkThis?.let { stopShowThis.text = kkThis }
        ThisThis?.let { stopShowThisThis.text = ThisThis }
        dao?.let { stopShowDao.text = "${dao}/小时" }
        size?.let { stopShowSize.text = size }


        var a = true
        stopShowOK.setOnClickListener {
            if (a){
                stopShowOK.text = "取消预订"
                a = false
            }else{
                stopShowOK.text = "预订车位"
                a = true
            }
        }
    }

    override fun onOptionsItemSelected(item: MenuItem): Boolean {
        finish()
        return super.onOptionsItemSelected(item)
    }
}